<?php
namespace Services;
/**
 * File holds class for inappropriate feedback data manipulation
 *
 * PHP version 5.3.5
 *
 * @category   CM
 * @package    Services
 * @subpackage -
 * @author     markus karileet <markuskarileet@hotmail.com>
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @link       -
 */
class InappropriateFeedback extends ORM {
	/**
	 * Method prepares inappropriate feedback object for insertion to database.
	 * @param \Entities\Feedback $fb Feedback that is inapproproate
	 * @param var $reason Reason for marking inappropriate
	 * @return int ID of inserted object
	 * @throws \Exception when insertion fails
	 */
	public function prepareInsert(\Entities\Feedback $fb, $reason) {
		$tmpl = new \Entities\InappropriateFeedback();
		$tmpl->setFeedback($fb->getId());
		$tmpl->setTime(time());
		$tmpl->setReason(\Misc\Tools::cleanInput($reason));
		return $this->insert($tmpl);
	}
}